package com.zzyl;

import cn.hutool.http.*;

public class testHutoolHttpUtil {

    private static final String token = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ0Mjc1NGY0LTgxNTMtNDg5NC05ODJmLWNiMjdjNDY2MzI1ZSJ9.mD6V4FNXTy98ab-hZv-JnI9wbcsBnCl3GGK2PVzz8AakTkLnKxq4wiQ4qD0vHCFjTWQS_5_piyuPnczZRvhk_A";


    public static void main(String[] args) {
        // 创建请求对象
        // HttpRequest request = HttpUtil.createRequest(参数1，参数2);  //参数1是 请求方式是枚举项，参数2是请求的完整路径
        // request.form() // 设置query传参
        // request.body() // 设置body 传参
        // request.header() // 设置请求头
        HttpResponse response = HttpUtil.createRequest(Method.GET, "192.168.34.150:8080/nursing/nursingLevel/listAll").header(
                "Authorization", token
        ).execute();

        if(response.isOk()){
            String body = response.body();
            System.out.println("body = " + body);

        }

    }
}
